﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using log4net;

namespace SendIndustrialNetwork
{
    public class LogHelp
    {
        public static ILog loginfo = log4net.LogManager.GetLogger("sendData");//loginfo
        public static ILog logerror = log4net.LogManager.GetLogger("sendData");//logerror
        public static ILog logoracle = log4net.LogManager.GetLogger("logoracle");
        public static ILog receiveSave = log4net.LogManager.GetLogger("receiveSave");

        private static ILog myLog = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public static void SetConfig()
        {
            log4net.Config.XmlConfigurator.Configure();
        }

        public static void WriteLog(string strInfo)
        {
            loginfo.Info(strInfo);
        }

        public static void WriteError(string strInfo, Exception e)
        {
            logerror.Error(strInfo, e);
        }

        public static void WriteOrcale(string strInfo, params object[] args)
        {
            logoracle.InfoFormat(strInfo, args);
        }
        public static void WriteOrcaleError(string strInfo, params object[] args)
        {
            logoracle.ErrorFormat(strInfo, args);
        }
    }
}